package org.yanfengying.car.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.yanfengying.car.domain.CarResources;
import org.yanfengying.car.mapper.CarResourcesMapper;
import org.yanfengying.car.service.ICarResourcesService;
import org.yanfengying.utils.service.impl.BastServerImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yanfengying
 * @since 2022-11-01
 */
@Service
public class CarResourcesServiceImpl extends BastServerImpl<CarResources> implements ICarResourcesService {

    @Autowired
    private CarResourcesMapper carResourcesMapper;
    @Override
    public void addOrUpdate(CarResources carResources) {
//        System.out.println("img:"+carResources.getImg());
//        System.out.println("viceimg:"+carResources.getImg());
//        System.out.println("moreimg:"+carResources.getImg());
        //先删除相关车辆的资源信息
        carResourcesMapper.delete(carResources.getCarId());
        //新增相关资源
        carResourcesMapper.insert(carResources);
    }
}
